package gdr.graphics;

import java.awt.*;

import gdr.map.*;
import gdr.battle.*;

/**
 * Mostra il cursore nella schermata di scontro
 * @author Giorgio Vitale
 *
 */
public class BattleMapCursor {
	public static final int NO_ACTION = -1;
	
	public static final int ENTER = 0;
	public static final int EXIT = 1;
	public static final int LEFT = 2;
	public static final int UP = 3;
	public static final int RIGHT = 4;
	public static final int DOWN = 5;
	
	protected CoordinateCalculator coordinateCalc;
	protected boolean isVisible = true;
	protected BattleManager manager;
	
	public void update(long elapsedTime){
		
	}
	
	public void render(Graphics2D g){
		if (!isVisible()) return;
		g.setColor(Color.red);
		g.fillRect(coordinateCalc.getX(coordinateCalc.getCenter()), 
				   coordinateCalc.getY(coordinateCalc.getCenter()), 
				   coordinateCalc.resize(CoordinateCalculator.UNIT_WIDTH), 
				   coordinateCalc.resize(CoordinateCalculator.UNIT_HEIGHT));
		
	}
	/**
	 * restituisce la posizione del cursore
	 * @return
	 */
	public Position getCursorPosition(){
		return coordinateCalc.getCenter();
	}
	
	public void setCursorPosition(Position pos){
		coordinateCalc.setCenter(pos);
	}
	
	public CoordinateCalculator getCoordinateCalc() {
		return coordinateCalc;
	}

	public void setCoordinateCalc(CoordinateCalculator coordinateCalc) {
		this.coordinateCalc = coordinateCalc;
	}
	

	public BattleManager getManager() {
		return manager;
	}

	public void setManager(BattleManager manager) {
		this.manager = manager;
	}

	public boolean isVisible() {
		return isVisible;
	}

	public void setVisible(boolean isVisible) {
		this.isVisible = isVisible;
	}
	
}
